<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="button" value="同意(5)" disabled=true id="btn" />
    <script>
        var time = 5;
        function my$(id) {
            return document.getElementById(id);
        }
        var timeId = setInterval(function () {
            time--;
            my$("btn").value = "同意(" + time + ")";
            if (time == 0) {
                //参数:要清理的定时的id的值
                clearInterval(timeId);
                my$("btn").disabled = false;
                my$("btn").value = "同意";
            }
        }, 1000)

    </script>
</body>

</html>